package entity;

import control.PasswordEncrypter;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 *
 * @author MONESI
 */
@Entity(name = "PARTICIPANT")
public class Participant implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Pattern(regexp = "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",
            message = "invalid email")
    @NotNull(message = "May not be empty")
    private String email;
    
    
    @Id
    private int eventId; 
   
    @Id
    @Pattern(regexp = "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",
            message = "invalid email")
    @NotNull(message = "May not be empty")
    private String userInvited;
    
    int outcome; // 0= Pending, 1= Accettata 2= Rifiutata
    
    int letta;
    
    public void setLetta(int l){
        this.letta=l;
    }
   
    public int getLetta(){
        return this.letta;
    }
    
    public void setOutcome(int out) {
        this.outcome = out;
    }
    public int getOutcome() {
        return outcome;
    }
    
    public void setEventid(int id) {
        this.eventId = id;
    }
    public int getEventid() {
        return eventId;
    }

    public void setEmail(String email) {
        this.email = email;
    }
    public String getEmail() {
        return email;
    }

    public String getInvited() {
        return userInvited;
    }

    public void setInvited(String uinv) {
        this.userInvited = uinv;
    }

    
}


